<!DOCTYPE html>
<html>
  <head>
    <title>Listing 6.8</title>
    <script type="text/javascript" src="../scripts/assert.js"></script>
    <link href="../styles/assert.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <script type="text/javascript">

      function Person(){}
      Person.prototype.dance = function(){};

      function Ninja(){}

      Ninja.prototype = new Person();                         //#1

      var ninja = new Ninja();
      assert(ninja instanceof Ninja,
             "ninja receives functionality from the Ninja prototype");
      assert(ninja instanceof Person, "... and the Person prototype");
      assert(ninja instanceof Object, "... and the Object prototype");
      assert(typeof ninja.dance == "function", "... and can dance!")

    </script>
  </body>
</html>
